<template>
  <div class="one">
    <div>One a 的数据是{{ a }}</div>
    <button @click="$emit('fn1')">fn1</button>
    <Two v-bind="$attrs" v-on="$listeners" />
  </div>
</template>
<script>
import Two from './Two.vue';
export default {
  name: 'One',
  components: {
    Two,
  },
  props: ['a'],
  mounted() {
    /* $attrs：接收父组件传递过来的props，不包含已经在当前组件接收的props的和动态样式 */
    console.log(this.$attrs);
    console.log(this.$listeners);
  },
};
</script>
<style scoped>
.one {
  border: 1px solid #000;
}
</style>
